package com.mall.dubbo.api;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mall.dubbo.mapper.CmsSubjectProductRelationMapper;
import com.mall.model.domain.CmsSubjectProductRelation;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * @author xyiaao
 * @description 针对表【cms_subject_product_relation(专题商品关系表)】的数据库操作Api实现
 * @createDate 2022-03-29 19:46:09
 */
@DubboService
public class CmsSubjectProductRelationApiImpl extends ServiceImpl<CmsSubjectProductRelationMapper, CmsSubjectProductRelation>
        implements CmsSubjectProductRelationApi {

    @Autowired
    private CmsSubjectProductRelationMapper subjectProductRelationMapper;

    @Override
    public List<CmsSubjectProductRelation> findByProductId(Integer id) {

        LambdaQueryWrapper<CmsSubjectProductRelation> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(CmsSubjectProductRelation::getProductId, id);

        List<CmsSubjectProductRelation> cmsSubjectProductRelations = subjectProductRelationMapper.selectList(queryWrapper);
        return cmsSubjectProductRelations;
    }

}




